package com.thread.threadfirst.marvel.citymaster.enums;

import lombok.Getter;

/**
 *0初始化 1成功  2 失败
 * @author vincen
 */
@Getter
public enum  IncomeStatus {

    IS1(1, "成功"),
    IS2(2, "失败");

    /**
     *
     */
    private final String description;
    /**
     *
     */
    private final Integer value;


    /**
     * @param value
     * @param description
     */
    IncomeStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 根据key获取枚举
     *
     * @param key
     * @return
     */
    public static IncomeStatus getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (IncomeStatus temp : IncomeStatus.values()) {
            if (temp.value.equals(key)) {
                return temp;
            }
        }
        return null;
    }

}
